<template>
    <el-select  v-model="loginUserForm.sex" placeholder="请选择">
        <el-option
                v-for="item in getDataByType()"
                :key="item.value"
                :label="item.label"
                :value="item.value">
        </el-option>
    </el-select>
</template>
<script>
    export default {
        name: 'tg_select',
        data() {
            return {
                option_data: {
                    sex_data: [{
                        value: '0',
                        label: '女'
                    }, {
                        value: '1',
                        label: '男'
                    }, {
                        value: '2',
                        label: '未知'
                    }]
                }
            }
        },
        methods: {
            getDataByType(){
                let dataString = 'this.option_data.' + this.dataType
                return eval(dataString)
            }
        },
        props:{
            dataType: {
                type: String,
                required: true

            },
            loginUserForm: {
                type: Object,
                required: true
            },
            value: {
                type: String,
                required: true
            }
        }
    }
</script>